package com.lys.emsystem.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lys.emsystem.entity.ChartData;
import com.lys.emsystem.entity.Student;
import com.lys.emsystem.mapper.StudentMapper;
import com.lys.emsystem.service.IStudentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lys.emsystem.vo.StudentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liyansheng
 * @since 2022-04-26
 */
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements IStudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public IPage<Student> search(Page page, StudentVo studentVo) {
        return studentMapper.search(page, studentVo);
    }

    @Override
    public Student getStudentById(Integer id) {
        return studentMapper.getStudentById(id);
    }

    @Override
    public List<ChartData> selectStudentSexCount(Integer userId) {
        return studentMapper.selectStudentSexCount(userId);
    }

    @Override
    public List<ChartData> selectStudentProvince(Integer userId) {
        return studentMapper.selectStudentProvince(userId);
    }

}
